package city.spring.modules.material.service;

import city.spring.modules.material.entity.MaterialSettingEntity;
import city.spring.modules.material.vo.MaterialVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

public interface MaterialSettingService extends IService<MaterialSettingEntity> {

    /**
     * 根据id获取物资信息
     *
     * @param id
     * @return
     */
    MaterialSettingEntity getById(String id);


    /**
     * 分页获取物资信息
     *
     * @param page    分页对象
     * @param wrapper 查询对象
     * @return 物资信息
     */
    IPage<MaterialVO> listPage(Page<? extends MaterialSettingEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MaterialSettingEntity> wrapper);


    /**
     * 分页 获取物资选择页面
     *
     * @param page
     * @param wrapper
     * @return
     */
    IPage<MaterialVO> getMaterialPage(Page<? extends MaterialSettingEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MaterialSettingEntity> wrapper);


    void updateMaterial(MaterialSettingEntity entity);

    IPage<MaterialVO> MaterialByCategoryIdlistPage(Page<? extends MaterialSettingEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends MaterialSettingEntity> wrapper, String categoryId);
}
